package aom.ju.ss.view.user

import aom.ju.ss.R
import aom.ju.ss.databinding.BecomeMakerBinding
import aom.ju.ss.utils.http.LP_API
import aom.ju.ss.utils.http.OKHttpUtils
import aom.ju.ss.utils.show
import aom.ju.ss.view.base.BaseActivity

class BecomeAMaker : BaseActivity() {
    private lateinit var binding: BecomeMakerBinding
    override fun init() {
        binding = viewBinding as BecomeMakerBinding
        binding.open.setOnClickListener {
            OKHttpUtils(activity)
                .SetApiUrl(LP_API.create_order)
                .SetKey(
                    "type",
                    "order_type",
                    "address_id",
                    "goods_id",
                    "sku_id",
                    "num",
                    "remark",
                    "cart_ids"
                )
                .SetValue("1","1","1","1","1","1","1","1")
                .POST(this)

        }

    }

    override fun ok(jsonString: String, httpTY: String) {
        super.ok(jsonString, httpTY)
    }

    override fun error(e: String, jsonString: String, httpTY: String) {
        super.error(e, jsonString, httpTY)
        e.show
    }

    override val lay: Int = R.layout.become_maker
}